********************************************************************************
***Replication Data for "Resisting the Blood Tax" -- Eight Colony Dataset*******
***Main Paper*******************************************************************
***Lindsey Pruett. September 2023***********************************************
***Stata 17.0*******************************************************************

clear

use "C:\Users\ldpru\OneDrive\Desktop\Replication_JOP\JOP_Pruett_draftevasion.dta" 


*Tables*************************************************************************
*Table 1. Pooled OLS

reg abs_pop Rails_per50k i.ccode i.year
outreg2 using ols.tex, tex(fragment pretty) replace	dec(2) pdec(3) alpha(0.001, 0.01, 0.05) keep(Rails_per50k placebo2 building_rail corvee_bin pcpop admin_total limit Total_posts altitude log_predist border_percent ind_fleuve precipitations coltotal log_distance wwi_resist log_area anc_comptoir)

reg abs_pop Rails_per50k pcpop wwi_resist anc_comptoir altitude border_percent log_predist log_distance  log_area  i.ccode i.year
outreg2 using ols.tex, tex(fragment pretty) append	dec(2) pdec(3) alpha(0.001, 0.01, 0.05) keep(Rails_per50k placebo2 building_rail corvee_bin pcpop admin_total limit Total_posts altitude log_predist border_percent ind_fleuve precipitations coltotal log_distance wwi_resist log_area anc_comptoir)

reg abs_pop Rails_per50k placebo2 pcpop altitude log_predist log_distance border_percent wwi_resist log_area anc_comptoir i.ccode i.year
outreg2 using ols.tex, tex(fragment pretty) append	dec(2) pdec(3) alpha(0.001, 0.01, 0.05) keep(Rails_per50k placebo2 building_rail corvee_bin pcpop admin_total limit Total_posts altitude log_predist border_percent ind_fleuve precipitations coltotal log_distance wwi_resist log_area anc_comptoir)

reg abs_pop Rails_per50k placebo2 building_rail corvee_bin pcpop admin_total border_percent limit altitude log_predist log_distance wwi_resist log_area anc_comptoir i.ccode i.year
outreg2 using ols.tex, tex(fragment pretty) append	dec(2) pdec(3) alpha(0.001, 0.01, 0.05) keep(Rails_per50k placebo2 building_rail corvee_bin pcpop admin_total limit Total_posts altitude log_predist border_percent ind_fleuve precipitations coltotal log_distance wwi_resist log_area anc_comptoir)

reg abs_pop Rails_per50k placebo2 building_rail corvee_bin pcpop admin_total limit Total_posts altitude log_predist border_percent ind_fleuve precipitations coltotal log_distance wwi_resist log_area anc_comptoir i.ccode i.year
outreg2 using ols.tex, tex(fragment pretty) append	dec(2) pdec(3) alpha(0.001, 0.01, 0.05) keep(Rails_per50k placebo2 building_rail corvee_bin pcpop admin_total limit Total_posts altitude log_predist border_percent ind_fleuve precipitations coltotal log_distance wwi_resist log_area anc_comptoir)

	*note: additional variables in model 5 are shown in the appendix

*Figures************************************************************************

*Figure 2: Example of Time Series

sort cercle year

twoway line abs_pop year if cercle=="Gourma", xlabel(1920(4)1938) lpattern(dash) || line abs_pop year if cercle=="Macina", xlabel(1920(4)1938) lcolor(g10) ||, xtitle(Year) ytitle(Absentees/Eligible Male Pop.) legend(label(1 "Gourma, Mali") label(2 "Macina, Mali")) scheme(s1mono)

*Figure 3: Example of Time Series in Rail/Non Rail Districts

twoway line abs_pop year if cercle=="Dedougou", xlabel(1920(4)1938) lpattern(dash) || line abs_pop year if cercle=="Bobodioulasso", xlabel(1920(4)1938) lcolor(g10) ||, xtitle(Year) ytitle(Absentees/Eligible Male Pop.) legend(label(1 "Dedougou, BF") label(2 "Bobo-Dioulasso, BF")) scheme(s1mono)
			
	*note: add note about railway opening in 1932

*Additional Statistics in Main Paper********************************************

* Average Eligible Population Density in Rail / Non-rail Districts
ttest pop_density, by(railway)

